typedef unsigned char Uint8; // 重新定义
typedef unsigned long int Uint64; 
typedef unsigned int Uint32;
typedef unsigned short int Uint16;
typedef signed int __int32_t;
// typedef unsigned int int32;
/*
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
*/

// extern 
// U64_Byte U64_DATA;
// struct Message;
struct Message
{
    int DeviceNumber;
    int role;
    int Year;
    int Month;
    int Day;
    int Hour;
    int Minute;
    int Second;
    int Millisecond;
    int FrameCnt;
    int GNSS_status;

    int UWB_status, satelliteNumber;
    double lx, ly, lz; // before fusion
    float x, y, z, vx, vy, vz; // before fusion
    float deltaX, deltaY, deltaZ;
    float HAcc, VAcc;

    int MessageID;
    int MessageLength;

    // set to 0
    double SpeedGround,  latitude_f, longitude_f, altitude_f, velocityX_f, velocityY_f, velocityZ_f;
    int Cog;
};
void SCIA_TO_FLC(struct Message m, unsigned char * data_buf);

typedef union i32_Byte
{
    __int32_t i32;
    struct
    {
        unsigned char Byte_0:8;
        unsigned char Byte_1:8;
        unsigned char Byte_2:8;
        unsigned char Byte_3:8;
    }BYTE;
}i32_Byte;

typedef union U32_Byte
{
    Uint32 U32;
    struct
    {
        unsigned char Byte_0:8;
        unsigned char Byte_1:8;
        unsigned char Byte_2:8;
        unsigned char Byte_3:8;
    }BYTE;
}U32_Byte;

typedef union U16_Byte
{
    Uint16 U16;
    struct
    {
        unsigned char Byte_0:8;
        unsigned char Byte_1:8;
    }BYTE;
}U16_Byte;

typedef union i16_Byte
{
    signed int i16t;
    struct
    {
        unsigned char Byte_0:8;
        unsigned char Byte_1:8;
    }BYTE;
}i16_Byte;

typedef union doub_Byte
{
    double doub;
    struct
    {
        unsigned char Byte_0;
        unsigned char Byte_1;
        unsigned char Byte_2;
        unsigned char Byte_3;
        unsigned char Byte_4;
        unsigned char Byte_5;
        unsigned char Byte_6;
        unsigned char Byte_7;
    }BYTE;
}doub_Byte;

typedef union sing_Byte
{
    float sing;
    struct
    {
        unsigned char Byte_0;
        unsigned char Byte_1;
        unsigned char Byte_2;
        unsigned char Byte_3;
    }BYTE;
}sing_Byte;

typedef union U64_Byte
{
    Uint64 U64;
    struct
    {
        signed char Byte_0;
        signed char Byte_1;
        signed char Byte_2;
        signed char Byte_3;
        signed char Byte_4;
        signed char Byte_5;
        signed char Byte_6;
        signed char Byte_7;
    }BYTE;
}U64_Byte;